<template>
  <div id='patientShiftLog' :class="['left', 'contentWidth',{'mainBig': $store.state.isCollapse ,'mainSmall': !$store.state.isCollapse }]">
    <div class="header clearfix">
      <div class="backTo" v-show="isBackShow" @click="back">
        <img src="../../../static/images/back.png" alt="返回" />
      </div>
      <div class="contentTopLeft left">
        <h2>交班日志</h2>
      </div>
      <maintopright></maintopright>
      <maintopleftbottom v-if="$store.state.stateData.isShowBottom"></maintopleftbottom>
    </div>
      <router-view></router-view>
  </div>
</template>
<script>
  import maintopright from '@/components/main/maintop/maintopRight'
  import maintopleftbottom from '@/components/main/maintop/maintopLeftBottom'
export default {
components:{
  maintopright,
  maintopleftbottom
},
 data(){
    return{
      isBackShow: false,
    }

    },
    watch: {
      $route: {
        handler(val, oldval) {
          //判断是否在体征指标详情页
          if (val.path.indexOf('/patientShiftLog/patientShiftLogList') != -1 ) {
            this.isBackShow = false;
            this.$store.state.stateData.isShowBottom = false;
          } else {
            this.isBackShow = true;
            this.$store.state.stateData.isShowBottom = true;
          }
        
        },
      }
    },
    mounted() {
      this.isRoute();
    },
    methods: {
      back() {
        if (this.$route.query.status == 1) {
          this.$store.state.stateData.status = 1;
          this.$router.push({
            name: 'patientShiftLogList',
            query: { item: 3, department: 1, },
            params: { type: this.$route.query.type, date: this.$route.query.date, msg: this.$route.query.msg}
          })
          setTimeout(()=>{
            this.$store.state.stateData.status = 2;
          },3000)
        //console.log(this.$route.query.date)
        //console.log(this.$route.query.msg)
        //console.log(this.$route.query.type)
        }
        },
         isRoute() {
        //判断是否在体征指标详情页
           if (this.$route.path.indexOf('/patientShiftLog/patientShiftLogList') != -1) {
             this.$store.state.stateData.isShowBottom = false;
             this.isBackShow = false;
           } else {
             this.isBackShow = true;
             this.$store.state.stateData.isShowBottom = true;

        }
      }
    }
}
</script>
<style scoped>
</style>

